function splitRange(start, end, numParts) {
    const rangeSize = Math.ceil((end - start + 1) / numParts);
    const ranges = [];

    for (let i = 0; i < numParts; i++) {
        const rangeStart = start + i * rangeSize;
        const rangeEnd = Math.min(rangeStart + rangeSize - 1, end);
        ranges.push({ start: rangeStart, end: rangeEnd });
    }

    return ranges;
}

const start = 0;
const end = 1000000;
const numParts = 10;

const result = splitRange(start, end, numParts);
console.log(result);